package server.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import server.model.entity.MenuEntity;

import java.util.List;

/**
 * 创建人:    xvzhe
 * 创建时间:
 * 修改时间:
 * 版本:      v1.0
 */
public interface MenuDao extends JpaRepository<MenuEntity, String> {
    @Query(value = "select * from menu_entity where id in (select menu_id from " +
            " role_navigation where role_id = ?2) and status = ?1",
            nativeQuery = true)
    List<MenuEntity> findByStatusAndRoleId(Boolean status, String roleId);
}
